package com.xxgc.ssm.po.req;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.xxgc.ssm.po.Users;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import springfox.documentation.annotations.ApiIgnore;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

public class UserLoginReg {
    @Data
    @ApiModel("用户实体类")
    //注册
    public static class RegisterBean extends Users {
        @Size(min = 4,max = 12,message = "昵称的长度在4~12之间！")
        @ApiModelProperty(value = "用户名(4~12之间)",required = true,example = "举例")
        @JsonProperty("uNickname")
        private String uNickname;

        @NotNull(message = "电话号码不能为空")
        @Pattern(regexp="^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$",message = "请输入正确的电话号码")
        @ApiModelProperty(value = "手机号",required = true,example = "13022225555")
        @JsonProperty("uPhone")
        private String uPhone;
    }

    //登录  手机号密码登录
    @Data
    @ApiModel
    public static class LoginBean extends Users{
        @ApiModelProperty(value = "电话号码",required = true,example = "13055552222")
        @NotNull(message = "电话号码不能为空")
        @Pattern(regexp="^((13[0-9])|(14[5|7])|(15([0-3]|[5-9]))|(18[0,5-9]))\\d{8}$",message = "请输入正确的电话号码")
        @JsonProperty("uPhone")
        private String uPhone;

        @ApiModelProperty(value = "密码(6~12之间)",required = true,example = "123456")
        @Size(min = 4,max = 12,message = "密码的长度在6~12之间！")
        @JsonProperty("uPassword")
        private String uPassword;
    }
}
